<?php
if (!defined('BASEPATH'))
    exit('no direct script allowed asshole!!');
$this->load->helper('html');
?>



<!-- JavaScript -->
<script type="text/javascript" src="<?= base_url() ?>js/wufoo.js"></script>

<script type="text/javascript">



</script>

<script src="<?= base_url() ?>js/jscal2.js"></script>
<script src="<?= base_url() ?>js/lang/en.js"></script>

<!-- CSS -->
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/form/form.css" media="screen, tv, projection" title="Default" />
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/jscal2.css" />
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/border-radius.css" />
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/steel/steel.css" />

 

<div id="container">
    <fieldset class="fieldset">
        <legend class="legend">
		
		<?
		if ($status == "detail") 
		{
		echo '| Detail Data Surat Keluar |</legend>';
		} else if ($status == "edit") {
		echo '| Edit Data Surat Keluar |</legend>';
		}
		else {
		echo '| Form Progress |</legend>';
		}
		?>

        <div id="contentform" style="border:solid thin #BBBBBB; height:350px; background-color:#F9F9F9; -moz-border-radius: 5px;  padding-top:10px; padding-bottom:0.3px; margin-right:100px; margin-left:100px;">

            <!-- Start value -->
            <?
            //Setting Value Jika Prosedur yang dilakukan adalah prosedur input biasa.
            $value = array(
                'id_proses_aktifitas' => "",              
                'kuota_volume' => "",
				'volume_existing' => "",
                'persentase_volume' => "",
                'act_form' => "aktifitas/save_nilai"
            );
			
            //Setting Value pada form Jika melakukan prosedur Edit terhadap data tertentu.
            if ($status == "edit") {
                $value['id_proses_aktifitas'] = $id_proses_aktifitas;
                $value['kuota_volume'] = $kuota_volume;
                $value['volume_existing'] = $volume_existing;
                $value['persentase_volume'] = $persentase_volume;
                $value['act_form'] = "" . $value['id_proses_aktifitas'];
            }//end if
            ?>

            <?= form_open_multipart($value["act_form"]); ?>
           
            <!-- End value -->

                        <table width="847" border="0" bordercolor="#F0F0F0">
                <tr>
                    <td width="905" height="150">
                        <form id="form1" name="form1" method="post">
                            <div align="left">
                                <table border="1" cellspacing="0">
                                    <tr align="center">
                                        <td width="50">No.</td>
                                        <td width="200">Nama Proses Aktifitas</td>
                                        <td width="25">Kuota Volume</td>
                                        <td width="50">Satuan</td>
                                        <td width="25">Volume sekarang</td>
										<td width="150">Persentase Pengerjaan</td>
                                    </tr>
									
									<?
									$no = 1;
									foreach ($data_form_nilai->result() as $row)
									{
										echo'
											<tr>
												<td align="center">'.$no.'</td>
												<td align="center">'.$row->nama_proses_aktifitas.'</td>
												<td align="center"><input name="kuota_volume'.$row->id_proses_aktifitas.'" id="kuota_volume" type="text" size="5"  value="'. $row->kuota_volume.'"/></td>
												<td align="center">'.$row->satuan.'</td>
												<td align="center"><input name="volume_existing'.$row->id_proses_aktifitas.'" id="volume_existing" type="text" size="5"  value="'. $row->volume_existing.'"/></td>
												<td align="center"><input name="persentase_volume'.$row->id_proses_aktifitas.'" id="persentase_volume" type="text" size="5"  value="'. $value['persentase_volume'].'"/> % </td>												
											</tr>
										';									
										$no++;
									}
									?>
																	
                                </table>
                            </div>
                            <!-- Start Button -->
                            <div align="left">
							    <input type="button" value="Hitung" onClick="hitungVolume();"/>
								<input type="submit" name="Submit" value="Simpan" onClick="hitungVolume();">
								<a href="<?php echo site_url('aktifitas/index/'.$row->id_bagian_jenis_aktifitas) ?>">
								<input type="button" value="Kembali" />
								</a>

							</div>
                        </form>        
                        <p align="center">&nbsp;</p></td></tr>
            </table>
        </div>
        <p>&nbsp;</p>
		
		<script type="text/javascript">//<![CDATA[

      var cal = Calendar.setup({
          onSelect: function(cal) { cal.hide() }
      });
      cal.manageFields("f_btn3", "TGL_SURAT", "%Y-%m-%d");
	  
	  function hitungVolume()
	  {
		var no = document.getElementById("row").value;
	    // no = 1;
		for (no>0)
		{
		var kv = document.getElementById("kuota_volume").value;
		var ve = document.getElementById("volume_existing").value;
		document.getElementById("persentase_volume").value = Math.round((ve/kv)* 100);
		}
	  }
	  
    //]]></script>
		
    </fieldset>
</div>
<p>
    <!--container-->
</p>
<p>&nbsp; </p>

